import request from '@/utils/request.js';
import { rsaEncrypt } from '@/utils/commonUtil3';

// 获取会员信息
export const reqMeneberList = data => request({ url: '/member/select', method: 'get', data });

// 获取非标商品分类列表
// export const reqGoodsCategoryList = data => request({ url: '/goods/category/select', method: 'get', data });

// 获取非标商品列表
export const reqGoodsList = data => request({ url: '/supplyNonstandard/select', method: 'get', data });

// 字典
export function getDictValueAndNameSource(data) {
	return request({
		url: '/sysDict/getDictValueAndNameSource',
		method: 'get',
		params: {
			typeCode: data
		}
	});
}

// 获取供应链库存列表
export const reqScmStockList = data => request({ url: '/commodity/select', method: 'get', data });

// 获取非标品库存列表
export const reqNonstandardStockList = data => request({ url: '/nonstandard/Commodity/select', method: 'get', data });

// 获取自营标品库存列表
export const reqSelfStockList = data => request({ url: '/selfCommodity/select', method: 'get', data });

// 添加非标点采项信息
export const reqAddPointPurchase = data => request({ url: '/nonstandard/pick/insert', method: 'post', data: { data: rsaEncrypt(data) } });

// 获取未提交点采项
export const reqUnSubmitPointPurchase = data => request({ url: '/nonstandard/pick/getPicked', method: 'get', data });

// 删除未提交点采项
export const reqDeleteUnSubmitPointPurchase = data => request({ url: '/nonstandard/pick/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });

// 删除所有未提交点采项
export const reqDeleteAllUnSubmitPointPurchase = data => request({ url: '/nonstandard/pick/batchDel', method: 'DELETE', data: { data: rsaEncrypt(data) } });

// 创建非标点采订单
export const reqCreateNonstandardOrder = data => request({ url: '/nonstandard/pick/insert/order', method: 'post', data: { data: rsaEncrypt(data) } });

// 获取非标点采订单列表
export const reqNonstandardOrderList = data => request({ url: '/nonstandard/pick/store/select', method: 'get', data });

// 获取点采订单详情
export const reqNonstandardOrderDetail = data => request({ url: '/nonstandard/pick/details', method: 'get', data });

// 获取期初盘点列表
export const reqInitialInventoryList = data => request({ url: '/pda/selectStocktakingByStore', method: 'get', data });

// 获取期初盘点详情
export const reqInitialInventoryDetail = data => request({ url: '/pda/getTasksSummaryByApp', method: 'get', data });

// 自营标品列表
export const reqSelfCommodityList = data => request({ url: '/selfCommodity/select', method: 'get', data });

// 自营非标品列表
export const reqNonstandardCommodityList = data => request({ url: '/nonstandard/Commodity/select', method: 'get', data });

// 添加门店自营商品档案
export const reqAddStoreCommodity = data => request({ url: '/selfCommodity/insert', method: 'post', data: { data: rsaEncrypt(data) } });

// 修改门店自营商品档案
export const reqUpdateStoreCommodity = data => request({ url: '/selfCommodity/update', method: 'put', data: { data: rsaEncrypt(data) } });

// 删除门店自营商品档案
export const reqDeleteStoreCommodity = data => request({ url: '/selfCommodity/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });

// 添加自营非标商品
export const reqAddNonstandardCommodity = data => request({ url: '/nonstandard/Commodity/insert', method: 'post', data: { data: rsaEncrypt(data) } });

// 修改自营非标商品
export const reqUpdateNonstandardCommodity = data => request({ url: '/nonstandard/Commodity/update', method: 'put', data: { data: rsaEncrypt(data) } });

// 删除非标自营商品
export const reqDeleteNonstandardCommodity = data => request({ url: '/nonstandard/Commodity/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });

// 分页查看订单列表
export const reqOrderList = data => request({ url: '/cashier/order/select', method: 'get', data });

// 订单退款
export const reqOrderRefund = data => request({ url: '/cashierReturns/refundPayment', method: 'post', data: { data: rsaEncrypt(data) } });

// 分页查看现金支付订单列表
export const reqCashOrderList = data => request({ url: '/cash/select', method: 'get', data });

// 查看现金订单详情
export const reqCashOrderDetail = data => request({ url: '/cash/selectStoreCashDetails', method: 'get', data });

// 门店获取核销记录
export const reqVerificationRecord = data => request({ url: '/tokenOrder/selectByStore', method: 'get', data });

// 收银分页查看退货订单列表
export const reqReturnOrderList = data => request({ url: '/cashierReturns/select', method: 'get', data });

// 收银查看退货详情
export const reqReturnOrderDetail = data => request({ url: '/cashierReturns/selectDetails', method: 'get', data });

// 分页条件查询交班列表
export const reqShiftList = data => request({ url: '/handover/list', method: 'get', data });

// 查询交班详情
export const reqShiftDetail = data => request({ url: '/handover/details', method: 'get', data });

// 销售报表数据
export const reqSalesReport = data => request({ url: '/reportForms/sellDate', method: 'get', data });

// 门店投诉工单表
export const reqComplaintOrder = data => request({ url: '/work/insert', method: 'post', data: { data: rsaEncrypt(data) } });

// 修改密码
export const reqUpdatePassword = data => request({ url: '/user/updatePWD', method: 'PUT', data: { data: rsaEncrypt(data) } });

// 采购报表
export const reqPurchaseReport = data => request({ url: '/reportForms/buyData', method: 'get', data });

// 零售价修改记录报表
export const reqChangePriceList = data => request({ url: '/reportForms/selectStorePriceLogs', method: 'GET', data });
// 临期预警
export const reqWarnList = data => request({ url: '/warn/select', method: 'GET', params: data });

// 获取商品兑换记录列表
export const reqExchangeList = data => request({ url: '/exchange/getList', method: 'GET', params: data });

// 分页条件查询非标商品档案
export const getNonstandardCommodityLists = data => request({ url: '/supplyNonstandard/select', method: 'get', data });

// 收银输入框查询门店商品
export const reqSearchCommodity = data => request({ url: '/commodity/selectByCategory', method: 'get', data });

// 获取销售订单表报
export const reqSalesOrderList = data => request({ url: '/reportForms/storeOrder/profit', method: 'get', data });

// 获取销售订单表报详情
export const reqSalesOrderDetail = data => request({ url: '/reportForms/storeOrder/details', method: 'get', data });
